package com.jintoufs.util;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by Administrator on 2015/6/24.
 */
public class ResponseUtil {
    /**
     * 向客户端写数据
     *
     * @param response
     * @param info
     */
    public static void writeInfo(HttpServletResponse response, String info) {
        try {
            response.setContentType("text/html;charset=UTF-8");
            response.setHeader("Pragma", "No-cache");
            response.setHeader("Cache-Control", "no-cache");
            response.setDateHeader("Expires", 0);
            response.getWriter().write(info);
            response.getWriter().flush();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }
}
